--TEST--
bool MySQLndUhConnection::killConnection(resource $connection, int $pid)
--SKIPIF--
<?php require_once('skipif.inc'); ?>
--FILE--
<?php
	require_once('config.inc');

	class proxy extends MySQLndUhConnection {
		public function killConnection($res, $pid) {
			printf("%s(%s)\n", __METHOD__, var_export(func_get_args(), true));
			var_dump($ret = parent::killConnection($res, $pid));
			return $ret;
		}
	}

	class proxy2 extends MySQLndUhConnection {
		public function killConnection($res, $pid) {
			return false;
		}
	}

	class proxy3 extends MySQLndUhConnection {
		public function killConnection($res, $pid) {
			return $res;
		}
	}

	class proxy4 extends MySQLndUhConnection {
		public function killConnection($res, $pid) {
			return $res;
		}
	}

	class proxy5 extends MySQLndUhConnection {
		public function killConnection($res, $pid) {
			return $res;
		}
	}

	class proxy6 extends MySQLndUhConnection {
		public function killConnection($res) {
			return true;
		}
	}

	$conn = mysqlnd_uh_test\connect::mysqli();
	mysqlnd_uh_test\query_test::mysqli($conn);
	$conn->kill($conn->thread_id);
	var_dump($conn->query("SELECT 1 FROM DUAL"));
	$errno = $conn->errno;

	$conn = mysqlnd_uh_test\connect::mysqli();
	mysqlnd_uh_set_connection_proxy(new proxy());
	mysqlnd_uh_test\query_test::mysqli($conn);
	$conn->kill($conn->thread_id);
	var_dump($conn->query("SELECT 1 FROM DUAL"));

	if (($tmp = $conn->errno) != $errno)
		printf("[001] Errno has changed from %d to %d\n", $errno, $tmp);

	$conn = mysqlnd_uh_test\connect::mysqli();
	mysqlnd_uh_set_connection_proxy(new proxy2());
	var_dump($conn->kill($conn->thread_id));
	var_dump($conn->errno);

	mysqlnd_uh_set_connection_proxy(new proxy3());
	var_dump($conn->kill($conn->thread_id));
	var_dump($conn->errno);

	mysqlnd_uh_set_connection_proxy(new proxy4());
	var_dump($conn->kill($conn->thread_id));
	var_dump($conn->errno);

	mysqlnd_uh_set_connection_proxy(new proxy5());
	var_dump($conn->kill($conn->thread_id));
	var_dump($conn->errno);

	mysqlnd_uh_set_connection_proxy(new proxy6());
	var_dump($conn->kill($conn->thread_id));
	var_dump($conn->errno);
	print "done!";
?>
--EXPECTF--
Strict Standards: Declaration of proxy6::killConnection() should be compatible with that of MySQLndUhConnection::killConnection() in %s on line %d
bool(false)
proxy::killConnection(array (
  0 => NULL,
  1 => %d,
))
bool(true)
bool(false)
bool(false)
int(0)

Warning: mysqli::kill(): (MySQLnd User Handler) The method MySQLndUhConnection::killConnection() did not return a boolean value as it should in %s on line %d
bool(true)
int(0)

Warning: mysqli::kill(): (MySQLnd User Handler) The method MySQLndUhConnection::killConnection() did not return a boolean value as it should in %s on line %d
bool(true)
int(0)

Warning: mysqli::kill(): (MySQLnd User Handler) The method MySQLndUhConnection::killConnection() did not return a boolean value as it should in %s on line %d
bool(true)
int(0)
bool(true)
int(0)
done!